#ifndef UTILITY_H
#define UTILITY_H


struct Coord
{
	int x;
	int y;

	Coord (int x, int y) : x (x), y (y) {};
};

bool operator<(const Coord first, const Coord second);
bool operator==(const Coord first, const Coord second);
bool isCoordValid(Coord coord, Coord mapsize);

typedef std::pair<Coord,Coord> StepType;
typedef std::vector<std::vector<int>> PrimTileMap;

// Implementation ----------------------------------------------------------------------------------

inline bool operator<(const Coord first, const Coord second)
{
    if (!(first.x == second.x)) {
        return first.x<second.x;
    }
    else {
        return first.y<second.y;
    }
}

inline bool operator==(const Coord first, const Coord second)
{
	if (first.x == second.x &&
		first.y == second.y)
		return true;
	return false;
}

inline bool isCoordValid(Coord coord, Coord mapsize)
{
    return (coord.x>=0 && coord.x < mapsize.x && coord.y>=0 && coord.y<mapsize.y);
}




#endif // UTILITY_H
